home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-13 / amac44c.zip / RFR002.QM < prev    next >
Text File  |  1992-04-26  |  13KB  |  277 lines

  1. *                               rfr002.qm
  2. *                  Switch Case and Captilization Macros
  3. *                        Written By Tom Hogshead
  4. *                       [ See RFRMxx.QM For Use ]
  5. *                                4/24/92
  6. *  Key     Subfile                       Description
  7. * =====  ==============  ==============================================
  8. * @(3)                   Capitalize First Letter of Words in COL  Block   |chg
  9. * @(4)                   Capitalize First Letter of Words in CHAR Block   |chg
  10. * @(5)                   Capitalize First Letter of Words in LINE Block   |chg
  11. * @(6)                   Make all Letters in Block LOWER Case
  12. * @(7)                   Make all Letters in Block UPPER Case
  13. * #(f1)                  Capitalize Word at Cursor
  14. * #(f2)                  Capitalize First Letter of Word at Cursor
  15. * #(f4)                  Un-Capitalize Word at Cursor
  16. * #(f6)                  Switch Case of First Letter of Word
  17. * #(f3)                  Switch Case of First Letter of Word, Loose Blocks
  18. * #(f9)                  Switch Case of First Letter of Word, Short version
  19. * #(f5)                  Move to First Letter of Word at Cursor
  20. * #(f8)                  (Short ver of #f5)
  21. * #(f7)                  Move to First Non-White Character of Current Line
  22. *
  23. *         {e:\up\RFRM*}--Return To RFRMxx.QM
  24. *
  25. *-- eoi
  26.  
  27. *                            M A C R O S
  28. * ----------------------------------------------------------------------
  29. * @(3)  Capitalize First Letter Of All Words In Column Block
  30. * ----------------------------------------------------------------------
  31. * Mark column block, then press @3 to capitalize first letter of every
  32. * Word in block.  Unmark when finished if OK.  Block MUST be a column
  33. * block, NOT a line or character block, and need not be closed. This
  34. * macro also unconditionally uppercases the first character of the
  35. * block, so be sure the block includes a full first word.
  36.  
  37. @3      macrobegin
  38.         setscreenoff                    * Remove if not v2.15              *|
  39.         AltWordSet                      * For all words
  40.         editfile "NUL" return quit      * Quit NUL
  41.         GotoBlockBeg jfalse END                                            *|
  42.         Editfile Return                 * Load NUL
  43.         Copyblock                       * Copy Block To NUL
  44.         lower                           * Make block lower case first      *|
  45.         Unmarkblock
  46.     LOOP:
  47.         Upper Wordright                 * Capitalize first letter each word
  48.     Jtrue LOOP                          * Continue until no more words
  49. * ------- Make Column Block of Widest Line (From @6 mis003.qm) -------*
  50.         begfile unmarkblock markcolumn
  51.      1: endline
  52.      2: cursorleft markcolumn cursordown jfalse 4
  53.      3: jump 1
  54.      4: copy quit                       * Copy block to scrap/quit Nul
  55.         Pasteover                       * Paste block back where it was
  56.     END:
  57.         DefaultWordSet
  58. *
  59. * 53 bytes Fri  02-22-1991  16:08:43
  60. * 50 bytes Mon  07-15-1991  07:56:46 (TH @3, changed c:! to NUL, shortened)
  61. * 61 bytes Mon  07-15-1991  20:40:59 (TH @3, added windows)
  62. * 63 bytes Mon  07-15-1991  21:16:49 (TH @3, added altwordset)
  63. * 53 bytes Mon  07-15-1991  22:52:27 (TH @3, removed #255)
  64. * 52 bytes Wed  07-17-1991  11:10:41 (TH @3, removed extra unmarkblock)
  65. * 51 bytes Fri  07-19-1991  00:43:20 (TH @3, removed markcolumn)
  66. * 40 bytes Fri  07-19-1991  14:26:26 (TH @3, removed window shrink)
  67. * 51 bytes Tue  07-23-1991  16:14:27 (TH @3, use weird char to mark Nul)
  68. * 31 bytes Mon  09-16-1991  17:16:45 (TH @3, removed windows/end block marker)
  69. * 32 bytes Tue  04-21-1992  11:28:14 (TH @3, make block lower case first)
  70. * 35 bytes Wed  04-22-1992  15:25:54 (TH @3, end macro if no block marked)
  71. * 36 bytes Fri  04-24-1992  08:48:49 (TH @3, For V2.15)
  72. * 46 bytes Fri  04-24-1992  08:58:58 (TH @3, changed column block marking)
  73.  
  74. * 
  75. *---------------------------------------------------------------
  76. * @(4)  Capitalize First Letter Of All Words In Character Block
  77. *---------------------------------------------------------------
  78. * Mark character block, then press @4 to capitalize first letter of
  79. * every word in block.  Unmark when finished if OK.  Block MUST be a
  80. * character block, NOT a column or line block, and need not be closed.
  81. * This macro also unconditionally uppercases the first character of the
  82. * block, so be sure the block includes a full first word.
  83.  
  84. @4      macrobegin
  85.         setscreenoff                    * Remove if not v2.15              *|
  86.         AltWordSet                      * For all words
  87.         EditFile "NUL" Return Quit      * Quit Nul if loaded
  88.         GotoBlockBeg jfalse END                                            *|
  89.         editfile return                 * Load NUL
  90.         moveblock                       * Move block to NUL
  91.         lower                           * Make block lower case            *|
  92.         Unmarkblock
  93.     LOOP:
  94.         Upper Wordright                 * Capitalize first letter each word
  95.     Jtrue LOOP                          * Continue until no more words
  96.         MarkCharacter Begfile           * Mark original block
  97.         copy quit                       * Copy block/quit Nul
  98.         Prevwindow                      * Return to starting file
  99.         paste                           * Paste block back where it was
  100.     END:                                                                   *|
  101.         DefaultWordSet                  * Reset
  102. *
  103. * 39 bytes Fri  07-19-1991  14:29:37 (TH @4)
  104. * 31 bytes Mon  09-16-1991  02:33:50 (TH @4, quit Nul first, removed windows)
  105. * 32 bytes Tue  04-21-1992  11:25:58 (TH @4, make block lower case first)
  106. * 35 bytes Wed  04-22-1992  15:27:17 (TH @4, end macro if no block marked)
  107. * 36 bytes Fri  04-24-1992  08:48:33 (TH @4, for v2.15)
  108.  
  109. * 
  110. *------------------------------------------------------------
  111. * @(5)  Capitalize First Letter Of All Words In Line Block
  112. *------------------------------------------------------------
  113. * Mark line block, then press @5 to capitalize first letter of every
  114. * word in block.  Unmark when finished if ok.  Block must be a line
  115. * block, not a column or character block, and need not be closed.
  116.  
  117. @5      macrobegin
  118.         setscreenoff                    * Remove if not v2.15              *|
  119.         AltWordSet                      * For all words
  120.         EditFile "NUL" Return Quit      * Quit Nul if loaded
  121.         GotoBlockBeg jfalse END                                            *|
  122.         editfile return                 * Load NUL
  123.         moveblock                       * Move block to NUL
  124.         lower                           * Make block lower case            *|
  125.         gotoblockend cursordown         * Test if last line is blank
  126.     jfalse 1                            * If not blank, test line on top
  127.         delline                         *ELSE last line is blank, delete it
  128.                                         * Qedit is set to insert block ABOVE
  129.     1:  Gotoblockbeg Cursorup           * Test If Line 1 Blank
  130.     Jfalse 2                            * If can't cursor up, line 1 not blnk
  131.         delline                         *ELSE line 1 is blank, delete it
  132.                                         * Qedit is set to insert block BELOW
  133.         prevfile cursorup nextfile      * Move cursor up one line in
  134.                                         *  starting file
  135.     2:  Unmarkblock                     * Unmark to begin caps
  136.     LOOP:
  137.         Upper Wordright                 * Capitalize first letter each word
  138.     Jtrue LOOP                          * Continue until no more words
  139.         Markline Begfile                * Finish Mark
  140.         copy quit                       * Copy block to scrap/quit Nul
  141.         paste                           * Paste block back where it was
  142.     END:                                                                   *|
  143.         DefaultWordSet                  * Reset
  144. *
  145. * 40 Bytes Fri  07-19-1991  14:25:09 (TH @5)
  146. * 46 bytes Fri  09-20-1991  21:43:07 (TH @5, for all QEdit settings)
  147. * 45 bytes Sun  09-22-1991  09:34:21 (TH @5, shortened)
  148. * 46 bytes Tue  04-21-1992  11:29:13 (TH @5, make block lower case first)
  149. * 49 bytes Wed  04-22-1992  15:28:39 (TH @5, end macro if no block marked)
  150. * 50 bytes Fri  04-24-1992  08:47:59 (TH @5, for v2.15)
  151.  
  152. * 
  153. * -----------------------------------------
  154. * @(6) Make all Letters in Block LOWER Case
  155. * -----------------------------------------
  156. @6 Macrobegin Lower
  157. *
  158. * 5 Bytes Tue  07-16-1991  08:58:48 (TH @6)
  159.  
  160. * 
  161. * -----------------------------------------
  162. * @(7) Make all Letters in Block UPPER Case
  163. * -----------------------------------------
  164. @7 Macrobegin Upper
  165. *
  166. * 5 Bytes Tue  07-16-1991  08:58:48 (TH @7)
  167.  
  168. * 
  169. * ----------------------------------------
  170. * #(f1) Capitalize Word at Cursor
  171. * ----------------------------------------
  172. #f1 macrobegin markword upper unmarkblock WordRight
  173. *
  174. * 7 bytes Mon  08-20-1990  07:17:53
  175. * 8 bytes Sun  09-22-1991  18:14:10 (TH #f1, added wordright)
  176.  
  177. * 
  178. * ----------------------------------------
  179. * #(f2) Capitalize First Letter of Word
  180. * ----------------------------------------
  181. #f2 macrobegin markword lower gotoblockbeg unmarkblock
  182.     markcolumn upper unmarkblock wordright
  183. *
  184. * 10 bytes Sun  03-10-1991  16:05:55
  185. * 12 bytes Thu  08-08-1991  16:36:11 (TH #f2, added lower and wordright)
  186.  
  187. * 
  188. * ----------------------------------------
  189. * #(f4) Un-capitalize Word At Cursor
  190. * ----------------------------------------
  191. #f4 Macrobegin Markword Lower Unmarkblock WordRight
  192. *
  193. * 7 Bytes Mon  08-20-1990  07:18:07
  194. * 8 bytes Sun  09-22-1991  18:14:52 (TH #f4, added wordright)
  195.  
  196. * 
  197. * ---------------------------------------------------------------
  198. * #(f3) Switch Case of First Letter of Current or Next Word Then
  199. *       Move to Next Word, Blocks are Lost
  200. * ---------------------------------------------------------------
  201. #f3 macrobegin markword gotoblockbeg unmarkblock flip wordright
  202. *
  203. * 11 bytes Sun  10-27-1991  10:10:37 (TH #f3)
  204. * 9 bytes Mon  10-28-1991  09:59:57 (TH #f3)
  205.  
  206. * 
  207. * ---------------------------------------------------------------
  208. * #(f5) Move Cursor to First Letter of Current or Next Word,
  209. *       Does Not Stop At EOL, Requires v2.15
  210. * ---------------------------------------------------------------
  211. #f5     macrobegin setscreenoff altwordset
  212.     DO: isbegline jfalse a  firstnonwhite jump e    * cursor was in col 1
  213.     a:  isendline jfalse b  wordright     jump e    * cursor was at eol
  214.     b:  splitline wordright isbegline    jtrue c
  215.         prevposition joinline wordright   jump e    * cursor was on space
  216.     c:  prevposition endline             jtrue d
  217.         joinline wordright wordleft       jump e    * cursor was in word
  218.     d:  prevposition joinline             jump e    * cursor was on first char
  219.     e:  wordright isendline jtrue END  wordleft     * if at eol
  220.    END: defaultwordset
  221. *
  222. * 57 bytes Mon  10-28-1991  14:04:02 (TH #f5)
  223.  
  224. * 
  225. * ---------------------------------------------------------------
  226. * #(f6) Switch Case of First Letter of Current or Next Word Then
  227. *       Move To Next Word, Maintain Blocks Unless Word Is In Block,
  228. *       Does Not Stop At EOL, Requires v2.15
  229. * ---------------------------------------------------------------
  230. #f6     macrobegin setscreenoff altwordset
  231.         iscursorinblock jfalse DO  unmarkblock
  232.     DO: isbegline jfalse a  firstnonwhite jump e    * cursor was in col 1
  233.     a:  isendline jfalse b  wordright     jump e    * cursor was at eol
  234.     b:  splitline wordright isbegline    jtrue c
  235.         prevposition joinline wordright   jump e    * cursor was on space
  236.     c:  prevposition endline             jtrue d
  237.         joinline wordright wordleft       jump e    * cursor was in word
  238.     d:  prevposition joinline             jump e    * cursor was on first char
  239.     e:  wordright isendline jtrue END  wordleft     * if at eol
  240.    END: Flip wordright defaultwordset
  241. *
  242. * 64 bytes Mon  10-28-1991  14:03:51 (TH #f6)
  243.  
  244. * aaa        "bbb Ccc  d
  245. * aaa        "bbb ccc  d
  246.  
  247. * 
  248. * --------------------------------------------------------------
  249. * #(f7) Move Cursor to First Non-White Character of Current Line
  250. * --------------------------------------------------------------
  251. * This may also be done with QEdit v2.15 using just "FirstNonWhite".
  252.  
  253. #f7 macrobegin insertline nextpara cursorup delline scrollup
  254. *
  255. * 9 bytes Tue  09-03-1991  18:31:04 (TH #f7)
  256.  
  257. * 
  258. * ---------------------------------------------------------------
  259. * #(f8) Move Cursor to First Letter of Current or Next Word,
  260. *       Short version of #f5
  261. * ---------------------------------------------------------------
  262. #f8 macrobegin markword gotoblockbeg unmarkblock
  263. *
  264. * 7 bytes Mon  10-28-1991  11:17:26 (TH #f8)
  265.  
  266. * 
  267. * ---------------------------------------------------------------
  268. * #(f9) Switch Case of First Letter of Current or Next Word Then
  269. *       Move to Next Word, Blocks are Retained
  270. * ---------------------------------------------------------------
  271. #f9 macrobegin wordright wordleft flip wordright
  272. *
  273. * 11 bytes Sun  10-27-1991  10:10:37 (TH #f3)
  274. * 9 bytes Mon  10-28-1991  09:59:57 (TH #f3)
  275. * 8 bytes Mon  10-28-1991  15:25:06 (TH #f9)
  276.  
  277.